<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      var num = Math.random() * 1
      console.log(num)
      var pro = new Promise((resolve, reject) => {
        if (num > 0.3) {
          resolve()
        } else {
          reject()
        }
      })
      pro.then(
        (resolve) => {
          console.log('resolve', num)
        },
        (reject) => {
          console.log('reject', num)
        }
      )
    </script>
  </body>
</html>
